package com.eorchis.module.news.ui.commond;

import java.io.Serializable;
import java.util.Date;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.validator.constraints.NotBlank;
import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.core.springext.mvc.propertyeditor.CustomDateSerializer;
import com.eorchis.core.ui.commond.ICommonField;
import com.eorchis.core.ui.commond.ICommond;
import com.eorchis.module.basedata.domain.BaseData;
import com.eorchis.module.news.domain.News;
import com.eorchis.utils.utils.PropertyUtil;


/**
 * Title: NewsValidCommond<br>
 * Description: 消息管理ValidCommond<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author RongSL
 * @createDate 2016-05-06
 * @version $Revision$
 */
public class NewsValidCommond implements ICommond,ICommonField {
	
	private News news;
	private String newsUserLink;//消息人员表ID
	private Integer lookState;// 显示状态 1：显示 2：不显示
	private String  userName;//人员名称
	private String  replyValue;//回复内容
	private Integer receiveNum;//接收未读消息数量
	private String userId;//用户ID
	private String Message;//上传返回的信息
	private boolean flag;//是否上传成功
	private String newsTypeCode;//消息类型编码
	private String receiveUserIds;//接收人用户ids
	private String[] receiveUserId;//接收人用户ids
	private String receiveUserNames;//接收人用户姓名数组
	private String receiveUserName;//接收人用户姓名
	private String[] newsIds;//消息ID数组
	private String searchClassID;//班级ID
	private String defaultValue;//默认班级信息
	private String attachName;//附件名称
	private String attachType;//附件类型
	private Integer replyState;//回复状态
	private Integer readState; //读取状态
	private String newsCode;//
	private String receiveTime;//回复时间
	
	private String treepath;//部门路径
	
	
	public String getNewsCode() {
		return newsCode;
	}
	public void setNewsCode(String newsCode) {
		this.newsCode = newsCode;
	}
	public Integer getReadState() {
		return readState;
	}
	public void setReadState(Integer readState) {
		this.readState = readState;
	}
	public Integer getReplyState() {
		return replyState;
	}
	public void setReplyState(Integer replyState) {
		this.replyState = replyState;
	}
	public String getClassName() {
		return news.getClassName();
	}
	public void setClassName(String className) {
		news.setClassName(className);
	}
	
	public String getNewsTitle(){
		return news.getNewsTitle();
	}
	
	public void setNewsTitle(String newsTitle){
		news.setNewsTitle(newsTitle);
	}
	
	public String getNewsUserLink() {
		return newsUserLink;
	}

	public void setNewsUserLink(String newsUserLink) {
		this.newsUserLink = newsUserLink;
	}

	public Integer getLookState() {
		return lookState;
	}

	public void setLookState(Integer lookState) {
		this.lookState = lookState;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getReplyValue() {
		return replyValue;
	}

	public void setReplyValue(String replyValue) {
		this.replyValue = replyValue;
	}

	public Integer getReceiveNum() {
		return receiveNum;
	}

	public void setReceiveNum(Integer receiveNum) {
		this.receiveNum = receiveNum;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public NewsValidCommond(){
		news = new News();
	}
	
	public NewsValidCommond(News news){
		this.news = news;
	}

	public Serializable getEntityID() {
		return news.getNewsId();
	}

	@Override
	public IBaseEntity toEntity() {
		return news;
	}

	/**
	 * 获取消息管理ID
	 */	
	@NotBlank
	public String getNewsId() {
		return news.getNewsId();
	}
	/**
	 * 设置消息管理ID
	 */		
	public void setNewsId(String newsId) {
		news.setNewsId(newsId);
	}
	/**
	 * 获取发送人显示状态
	 */	
	public Integer getSendLookState() {
		return news.getSendLookState();
	}
	/**
	 * 设置发送人显示状态
	 */		
	public void setSendLookState(Integer sendLookState) {
		news.setSendLookState(sendLookState);
	}
	/**
	 * 获取附件ID
	 */	
	public String getAttachmentId() {
		return news.getAttachmentId();
	}
	/**
	 * 设置附件ID
	 */		
	public void setAttachmentId(String attachmentId) {
		news.setAttachmentId(attachmentId);
	}
	/**
	 * 获取消息内容
	 */	
	public String getNewsValue() {
		return news.getNewsValue();
	}
	/**
	 * 设置消息内容
	 */		
	public void setNewsValue(String newsValue) {
		news.setNewsValue(newsValue);
	}
	/**
	 * 获取类型ID
	 */	
	public BaseData getNewsType() {
		return news.getNewsType();
	}
	/**
	 * 设置类型ID
	 */		
	public void setNewsType(BaseData newsType) {
		news.setNewsType(newsType);
	}

	@JsonSerialize(using = CustomDateSerializer.class)
	public Date getCreateDate() {
		return news.getCreateDate();
	}

	public void setCreateDate(Date createDate) {
		news.setCreateDate(createDate);
	}

	@Override
	public Integer getActiveState() {
		return news.getActiveState();
	}

	@Override
	public void setActiveState(Integer activeState) {
		news.setActiveState(activeState);
	}

	public String getMessage() {
		return Message;
	}

	public void setMessage(String message) {
		Message = message;
	}
	public boolean isFlag() {
		return flag;
	}

	public void setFlag(boolean flag) {
		this.flag = flag;
	}

	public String getNewsTypeCode() {
		if(PropertyUtil.objectNotEmpty(news.getNewsType())){
			return news.getNewsType().getDataCode();
		}
		return newsTypeCode;
	}

	public void setNewsTypeCode(String newsTypeCode) {
		this.newsTypeCode = newsTypeCode;
	}
	
	public String getSendUserId() {
		return news.getSendUserId();
	}
	public void setSendUserId(String sendUserId) {
		news.setSendUserId(sendUserId);
	}

	public String getReceiveUserName() {
		return receiveUserName;
	}

	public void setReceiveUserName(String receiveUserName) {
		this.receiveUserName = receiveUserName;
	}

	public String[] getReceiveUserId() {
		return receiveUserId;
	}

	public void setReceiveUserId(String[] receiveUserId) {
		this.receiveUserId = receiveUserId;
	}

	public String[] getNewsIds() {
		return newsIds;
	}

	public void setNewsIds(String[] newsIds) {
		this.newsIds = newsIds;
	}

	public String getDefaultValue() {
		return defaultValue;
	}

	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}

	public String getSearchClassID() {
		return searchClassID;
	}

	public void setSearchClassID(String searchClassID) {
		this.searchClassID = searchClassID;
	}

	public String getReceiveUserIds() {
		return receiveUserIds;
	}

	public void setReceiveUserIds(String receiveUserIds) {
		this.receiveUserIds = receiveUserIds;
	}

	public String getReceiveUserNames() {
		return receiveUserNames;
	}

	public void setReceiveUserNames(String receiveUserNames) {
		this.receiveUserNames = receiveUserNames;
	}

	public String getFileSize() {
		return news.getFileSize();
	}

	public void setFileSize(String fileSize) {
		news.setFileSize(fileSize);
	}

	public String getAttachName() {
		return attachName;
	}

	public void setAttachName(String attachName) {
		this.attachName = attachName;
	}

	public String getAttachType() {
		return attachType;
	}

	public void setAttachType(String attachType) {
		this.attachType = attachType;
	}
	
	public String getReceiveTime() {
		return receiveTime;
	}
	
	public void setReceiveTime(String receiveTime) {
		this.receiveTime = receiveTime;
	}
	public String getTreepath() {
		return treepath;
	}
	public void setTreepath(String treepath) {
		this.treepath = treepath;
	}
	
}
